home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / V2 / DJTST200.ZIP / tests / libc / posix / dirent / opend.c < prev   
Encoding:
C/C++ Source or Header  |  1996-01-25  |  327 b   |  21 lines

  1. #include <dirent.h>
  2. #include <stdio.h>
  3.  
  4. int
  5. main(int argc, char **argv)
  6. {
  7.   DIR *d;
  8.   struct dirent *de;
  9.   printf("opend(%s)\n", argv[1]);
  10.   d = opendir(argv[1]);
  11.   if (d == 0)
  12.   {
  13.     perror(argv[1]);
  14.     return 1;
  15.   }
  16.   while ((de=readdir(d)))
  17.     printf("%s\n", de->d_name);
  18.   closedir(d);
  19.   return 0;
  20. }
  21.